<style>
.perm-layout-1 {
    padding: 3px 0px;
        padding-top: 3px;
        padding-right-value: 0px;
        padding-bottom: 3px;
        padding-left-value: 0px;
        padding-left-ltr-source: physical;
        padding-left-rtl-source: physical;
        padding-right-ltr-source: physical;
        padding-right-rtl-source: physical;
}
.perm-layout-2 {
    padding-left: 30px;
        padding-left-value: 30px;
        padding-left-ltr-source: physical;
        padding-left-rtl-source: physical;
}
</style>


<div class="perm-container">
<div class="">拥有所有权限：
   <label><input id="all" type="radio" name="super">是</label>
   <label><input id="notAll" type="radio" name="super" checked="checked"/>否</label>
</div>
<#--图片处理权限-->
<#assign imgPerms="/common/v_image_area_select.do,/common/o_image_cut.do,/common/o_upload_image.do"/>
<#--默认有的权限，比如后台首页-->
<input type="hidden" name="perms" value="/index.do,/top.do,/main.do,/left.do,/right.do,/logout.do,/common/v_,/common/o_"/>

	<div class="perm-layout-1">
	<label><input value="/fck/upload.do" type="checkbox" name="perms"/>图片上传</label>
	</div>
    <div class="perm-layout-1">
	<label><input value="/discuss/" type="checkbox" name="perms"/>商品评论</label>
	</div>
	<div class="perm-layout-1">
	<label><input value="/consult/" type="checkbox" name="perms"/>顾客咨询</label>
	</div>
	<div class="perm-layout-1">
	<label><input value="/productStatistics/" type="checkbox" name="perms"/>库存预警</label>
	</div>
	<div class="perm-layout-1">
	<label><input value="/productStatistics/" type="checkbox" name="perms"/>利润排行</label>
	</div>
<div class="perm-layout-1">
<label><input value="/frame/category_,/category/v_left.do,/category/v_tree.do,/category/v_list.do,/category/o_priority.do" type="checkbox" name="perms"/><@s.m "shop.function.category"/></label>
	<div class="perm-layout-2">
	<input value="/type/v_add.do,/type/o_save.do,/type/v_,/type/o_,/type/" type="hidden" name="perms"/>
	<label><input value="/category/v_add.do,/category/o_save.do,/category/v_checkPath.do,/common/v_,/common/o_" type="checkbox" name="perms"/><@s.m "global.add"/></label>
	<label><input value="/category/v_edit.do,/category/o_update.do,/common/v_,/common/o_" type="checkbox" name="perms"/><@s.m "global.edit"/></label>
	<label><input value="/category/o_delete.do" type="checkbox" name="perms"/><@s.m "global.delete"/></label>
	<label><input value="/typeProperty/v_add.do,/typeProperty/o_save.do,/typeProperty/v_,/typeProperty/o_,/typeProperty/" type="checkbox" name="perms"/>类型管理</label>	
	</div>
</div>
<div class="perm-layout-1">
<label><input value="/frame/product_,/product/v_left.do,/product/v_tree.do,/product/v_list.do,/tag/v_list.do" type="checkbox" name="perms"/><@s.m "shop.function.product"/>:</label>
	<div class="perm-layout-2">
	<label><input value="/product/o_saveFashion.do,/product/v_addFashion.do,/product/v_search.do,/product/v_combinationsearch.do,/product/v_standardTypes_add.do,/product/v_add.do,/product/o_save.do,/common/o_swfPicsUpload.do,/common/v_,/common/o_" type="checkbox" name="perms"/><@s.m "global.add"/></label>
	<label><input value="/product/v_addFashion.do,/product/o_saveFashion.do,/product/o_fashionUpdate.do,/common/o_swfPicsUpload.do,/product/v_edit.do,/product/o_update.do,/product/o_delFashion.do,/product/v_search.do,/common/v_,/common/o_" type="checkbox" name="perms"/><@s.m "global.edit"/></label>
	<label><input value="/product/o_delete.do" type="checkbox" name="perms"/><@s.m "global.delete"/></label>	
	<label><input value="/product/o_prohibit.do,/product/v_pacthProhibit.do,/v_pacthNotProhibit.do" type="checkbox" name="perms"/>禁售功能</label>
	<label><input value="/product/a_update.do,/product/v_shangjia.do,/product/v_xiajia.do" type="checkbox" name="perms"/>下架功能</label>
	<label><input value="/product/v_tuijian.do,/shopTuijanproduct/o_save.do,/shopTuijanproduct/v_list.do" type="checkbox" name="perms"/>推荐商品</label>
	<label><input value="/noctice/v_,/noctice/o_" type="checkbox" name="perms">到货通知</label>
	<label><input value="/tag/v_list.do,/tag/o_" type="checkbox" name="perms"/>商品标签</label>
	<label><input value="/consumertop/v_,/consumertop/o_,/consumertop/refer.do" type="checkbox" name="perms"/>消费排行</label>
	<label><input value="/salesstatistic/v_,/salesstatistic/o_,/salesStatistic/refer.do" type="checkbox" name="perms"/>销售统计</label>
	<!-- <label><input value="/product/o_stockCount.do" type="checkbox" name="perms"/>保存库存</label>
	<label><input value="/product/o_salePrice.do" type="checkbox" name="perms"/>保存售价</label> -->
	</div>
</div>
<div class="perm-layout-1">
   <label><input value="/frame/storeManager_,/store/v_left.do,/store/v_list.do" type="checkbox" name="perms"/><@s.m "shop.function.store"/>:</label>
   <div clas="perm-layout-2">
      <label><input value="/store/,/common/v_,/common/o_" type="checkbox" name="perms">店铺管理</label>
      <label><input value="/balance/v_list.do,/balance/v_excel.do,/balance/v_balance.do,/balance/o_save.do,/balance/v_notelist.do,/balance/o_save.do" type="checkbox" name="perms"/>财务结算</label>
      <label><input value="/brand/" type="checkbox" name="perms"/>销售列表</label>
      <label><input value="/store/v_forbiddenlist.do,/store/v_unfreeze.do,/store/o_delete.do" type="checkbox" name="perms"/>店铺冻结</label>
      <label><input value="/refund/" type="checkbox" name="perms"/>退款管理</label>
      <label><input value="/report/,/reportType/" type="checkbox" name="perms"/>举报投诉管理</label>
      <label><input value="/aftersale/" type="checkbox" name="perms"/>售后管理</label>
      <label><input value="/aftersaleType/,/aftersaleDemand/" type="checkbox" name="perms"/>售后服务</label>
      <label><input value="/shopLevel/" type="checkbox" name="perms"/>店铺等级管理</label>
   </div>
</div>

<div class="perm-layout-1">
   <label><input value="/frame/user_" type="checkbox" name="perms"/><@s.m "shop.function.user"/>:</label>
   <div class="perm-layout-2">
      <label><input value="/member/" type="checkbox" name="perms"/><@s.m "member.function"/></label>
      <label><input value="/group/" type="checkbox" name="perms"/><@s.m "group.function"/></label>
      <label><input value="/admin/" type="checkbox" name="perms"/><@s.m "admin.function"/></label>
      <label><input value="/commonAdmin/" type="checkbox" name="perms"/>管理员解锁</label>
      <label><input value="/dictionary/" type="checkbox" name="perms"/><@s.m "shopDictionary.function"/></label>
      <label><input value="/role/" type="checkbox" name="perms"/><@s.m "role.function"/></label>
      <label><input value="/consult/" type="checkbox" name="perms"><@s.m "shop.function.consult"/></label>
      <label><input value="/discuss/" type="checkbox" name="perms"/><@s.m "shop.function.discuss"/></label>
      <label><input value="/message/" type="checkbox" name="perms"/>站内信管理</label>
      <label><input value="/log/" type="checkbox" name="perms"/>日志管理</label>  
   </div>
</div>

<div class="perm-layout-1">
  <label><input value="/frame/channel_,/channel/v_left.do,/channel/v_tree.do,/channel/v_list.do,/channel/o_priority.do" type="checkbox" name="perms"/><@s.m "shop.function.channel"/></label>
  <div class="perm-layout-2">
	  <label><input value="/channel/v_add.do,/channel/o_save.do,/common/v_,/common/o_" type="checkbox" name="perms"/><@s.m "global.add"/></label>
	  <label><input value="/channel/v_edit.do,/channel/o_update.do,/common/v_,/common/o_" type="checkbox" name="perms"/><@s.m "global.edit"/></label>
	  <label><input value="/channel/o_delete.do" type="checkbox" name="perms"/><@s.m "global.delete"/></label>
  </div>
</div>

<div class="perm-layout-1">
   <label><input value="/frame/article_,/article/v_left.do,/article/v_tree.do,/article/v_list.do" type="checkbox" name="perms"/><@s.m "shop.function.article"/>:</label>
   <div class="perm-layout-2">
      <label><input value="/article/v_add.do,/article/o_save.do,/common/v_,/common/o_" type="checkbox" name="perms"/><@s.m "global.add"/></label>
      <label><input value="/article/v_edit.do,/article/o_update.do,/common/v_,/common/o_" type="checkbox" name="perms"/><@s.m "global.edit"/></label>
      <label><input value="/article/o_delete.do" type="checkbox" name="perms"/><@s.m "global.delete"/></label>
   </div>
</div>

<div class="perm-layout-1">
   <label><input value="/frame/template,/template/v_left.do,/template/v_tree.do,/template/v_list.do"/ type="checkbox" name="perms"><@s.m "shop.function.template"/></label>
   <div class="perm-layout-2">
      <label><input value="/template/v_add.do,/template/o_save.do" type="checkbox" name="perms"/><@s.m "global.add"/></label>
      <label><input value="/template/v_edit.do,/template/o_update.do" type="checkbox" name="perms"/><@s.m "global.edit"/></label>
      <label><input value="/template/o_delete.do,/template/o_delete_single.do" type="checkbox" name="perms"/><@s.m "global.delete"/></label>
      <label><input value="/template/o_create_dir.do" type="checkbox" name="perms"/>创建目录</label>
      <label><input value="/template/v_solution.do,/template/o_import.do,/template/o_export.do" type="checkbox" name="perms"/>pc端设置</label>
      <label><input value="/template/v_mobile_solution.do,/template/o_mobileImport.do,/template/o_mobileExport.do" type="checkbox" name="perms"/>移动端设置</label>
      <label><input value="/template/v_rename.do,/template/o_rename.do" type="checkbox"name="perms"/>重命名</label>
   </div>
</div>

<div class="perm-layout-1">
   <label><input value="/frame/resource,/resource/v_left.do,/resource/v_list.do,/resource/v_tree.do" type="checkbox" name="perms"/><@s.m "shop.function.resource"/></label>
   <div class="perm-layout-2">
     <label><input value="/resource/v_add.do,/resource/o_save.do" type="checkbox" name="perms"/><@s.m "global.add"/></label>
     <label><input value="/resource/v_edit.do,/resource/o_update.do" type="checkbox" name="perms"/><@s.m "global.edit"/></label>
     <label><input value="/resource/o_delete.do,/resource/o_delete_single.do" type="checkbox" name="perms"/><@s.m "global.delete"/></label>
     <label><input value="/resource/o_create_dir.do" type="checkbox" name="perms"/>创建目录</label>
     <label><input value="/resource/o_swfupload.do" type="checkbox" name="perms"/>上传文件</label>
     <label><input value="/resource/v_rename.do,/resource/o_rename.do" type="checkbox" name="perms"/>重命名</label>
   </div>
</div>

<div class="perm-layout-1">
  <label><input value="/frame/assistant_,/adspace/v_list.do" type="checkbox" name="perms"/><@s.m "shop.function.assistant"/></label>
  <div>
  <div class="perm-layout-2">
     <label><input value="/product/o_create_index.do" type="checkbox" name="perms"/><@s.m "product.createIndex"/></label>
  </div>
  <div class="perm-layout-2">
     <label><input value="/adspace/" type="checkbox" name="perms"/><@s.m "adspace.function"/></label>
  </div>
  <div class="perm-layout-2">
     <label><input value="/advertise/" type="checkbox" name="perms"/><@s.m "advertise.function"/></label>
  </div>
  <div class="perm-layout-2">
     <label><input value="/brand/" type="checkbox" name="perms"/><@s.m "brand.function"/></label>
  </div>
  <div class="perm-layout-2">
     <label><input value="/storeModel/" type="checkbox" name="perms"/>店铺模板</label>
  </div>
  <div class="perm-layout-2">
     <label><input value="/standardType/" type="checkbox" name="perms"/>规格类型</label>
  </div>
  <div class="perm-layout-2">
     <label><input value="/gift/" type="checkbox" name="perms"/>礼品管理</label>
  </div>
  <div class="perm-layout-2">
     <label><input value="/coupon/,/common/v_,common/o_" type="checkbox" name="perms"/>优惠券</label>
  </div>
  <div class="perm-layout-2">
     <label><input value="/poster/" type="checkbox" name="perms"/>海报</label>
  </div>
  <div class="perm-layout-2">
     <label><input value="/exended/" type="checkbox" name="perms"/>扩展属性</label>
  </div>
  <div class="perm-layout-2">
     <label><input value="/shopTuijian/v_,/shopTuijanproduct/v_,/shopTuijanproduct/o_,/shopTuijian" type="checkbox" name="perms"/>推荐分类</label>
  </div>
  <div class="perm-layout-2">
     <label><input value="/customerService/" type="checkbox" name="perms"/>在线客服</label>
  </div>
  <!-- <div class="perm-layout-2">
     <label><input value="/popularityGroup/" type="checkbox" name="perms"/>优惠套装</label>
  </div> -->
  </div>
</div>

<div class="perm-layout-1">
   <label><input value="/frame/config" type="checkbox" name="perms" type="checkbox" name="perms"/><@s.m "shop.function.config"/></label>
   <div>
   <div class="perm-layout-2">
      <label><input value="/config/v_global_edit.do,/config/o_global_update.do" type="checkbox" name="perms"/><@s.m "shop.config.global.function"/></label>
   </div>
   <div class="perm-layout-2">
      <label><input value="/config/v_basic_edit.do,/config/o_basic_update.do" type="checkbox" name="perms"/><@s.m "shop.config.basic.function"/></label>
   </div>
   <div class="perm-layout-2">
      <label><input value="/config/v_email_edit.do,/config/o_email_update.do" type="checkbox" name="perms"/><@s.m "shop.config.email.function"/></label>
   </div>
   <div class="perm-layout-2">
      <label><input value="/shipping/" type="checkbox" name="perms" type="checkbox" name="perms"/><@s.m "shipping.function"/></label>
   </div>
   <div class="perm-layout-2">
     <label><input value="/payment/" type="checkbox" name="perms" type="checkbox" name="perms"/><@s.m "payment.function"/></label>
   </div>
   <!-- <div class="perm-layout-2">
      <label><input value="/config/v_dataBackup.do,/config/o_dataBackup.do" type="checkbox" name="perms"/>数据备份</label>
   </div> -->
   <div class="perm-layout-2">
      <label><input value="/address/" type="checkbox" name="perms"/><@s.m "shop.config.district.function"/></label>
   </div>
   <div class="perm-layout-2">
      <label><input value="/logistics/" type="checkbox" name="perms"/>物流公司</label>
   </div>
   </div>
</div>

<div class="perm-layout-1">
<label><input value="/frame/order_,/order/v_list.do" type="checkbox" name="perms"/><@s.m "shop.function.order"/>:</label>
	<div class="perm-layout-2">
	<label><input value="/order/v_edit.do,/order/o_update.do,/order/o_returnMoney.do,/order/ajaxtotalDeliveryFee.do,/order/v_sendGoods.do,/order/o_sendGoods.do" type="checkbox" name="perms"/><@s.m "global.edit"/></label>
	<label><input value="/order/v_view.do" type="checkbox" name="perms"/>查看</label>
	<label><input value="/order/o_affirm.do,/order/v_sendGoods.do,/order/o_accomplish.do,/order/o_abolish.do" type="checkbox" name="perms"/>修改订单流程</label>
	<label><input value="/order/o_delete.do" type="checkbox" name="perms"/><@s.m "global.delete"/></label>	
	<label><input value="/shipments/v_,/shipments/o_" type="checkbox" name="perms"/>发货管理</label>
	<label><input value="/orderReturn/v_,/orderReturn/o_" type="checkbox" name="perms"/>退款，等待买家确认</label>
	<label><input value="/shopYushou/v_,/shopYushou/o_" type="checkbox" name="perms"/>预售订单</label>
	</div>
</div>
</div>


<script type="text/javascript">
$(function() {
	$(".perm-container input[type=checkbox]").bind("click",function() {
		parentCheck(this);
		childCheck(this);
	});
	$('#all').bind("click",function(){
		$(".perm-container input[type=checkbox]").attr("checked",true);
	})
	$("#notAll").bind("click",function(){
		$(".perm-container input[type=checkbox]").attr("checked",false);
	})
});
function parentCheck(chk) {
	var obj = $(chk).parent().parent().parent();
	while(obj && obj.attr("class").indexOf("perm-container")==-1) {
		if(chk.checked) {
			$(obj.children()[0]).children().attr("checked",true);
		}
		obj = obj.parent();
	}
}
function childCheck(chk) {
	$(chk).parent().next().children().find("input[type=checkbox]").each(function(){this.checked=chk.checked});
} 
function allCheck(chk){
	
}
</script>
